// 针对member的API操作都写在这里

import service from ".";

// 将所有的针对member的请求，都封装到一个对象中
const memberApi = {
    add(member){
        return service.post(
            '/member',
            member
        ).then(response=>response.data);
    },
    search(params){
        return service.get(
            '/member',
            {params},    // 传递参数
        ).then(response=>response.data);
    },
    edit(member){
        return service.put(
            '/member',
            member,
        ).then(response=>response.data);
    },
    remove(id){
        return service.delete(
            '/member/'+id,
        ).then(response=>response.data);
    },
};

export default memberApi;